const SourceLocation = @This();

file: [:0]const u8,
fn_name: [:0]const u8,
line: u32,
column: u32,

const std = @import("std");

pub fn init(src: std.builtin.SourceLocation) SourceLocation {
    const src_lct = SourceLocation{
        .column = src.column,
        .file = src.file,
        .fn_name = src.fn_name,
        .line = src.line,
    };
    return src_lct;
}
pub fn format(self: @This(), comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {
    if (fmt.len != 0) std.fmt.invalidFmtError(fmt, self);
    _ = options;
    try std.fmt.format(writer, "file: {s}, fn_name: {s}, line: {}, column: {}", .{
        self.file,
        self.fn_name,
        self.line,
        self.column,
    });
}
